<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>监听器</title>
  <script src="../vue.js"></script>
</head>

<body>
  <!-- 
    watch监听器
    作用:监听数据变化
   -->
  <div id="app">
    <input v-model="uesername" type="text" name="" id="">
  </div>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        uesername: ''
      },
      methods: {

      },
      computed: {

      },
      watch: {
        uesername(newValue, oldValue) {
          console.log(newValue, oldValue);
        }
      }
    })
  </script>
</body>

</html>